<?php
/**
 * User: Administrator
 * Time: 2015/10/27 20:19
 */


$reader = new XMLReader();
$reader->open('../file/test.xml', 'utf-8');
$count = 0;
while ($reader->read()) {
	if ($reader->name == "cd" && $reader->nodeType == XMLReader::ELEMENT) {
		$count++;
		while ($reader->read() && $reader->name != "cd") {
			if ($reader->nodeType != XMLReader::ELEMENT) continue;
			$name = $reader->name;
			echo 'name:' . $name . PHP_EOL;
		}

	}
}
$reader->close();
echo $count;

